<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title></title>
  <script src="../vue.js"></script>
</head>

<body>

  <div id="app">
    按键：<input type="text" @keydown='keyshow()'>
    回车：<input type="text" @keydown.enter='keyshow()'>
    字母(可以跟多个)：<input type="text" @keydown.q.w.e='keyshow()'>
    数字1：<input type="text" @keydown.one='keyshow()'>
    鼠标：<input type="button" value="鼠标左击" @click.prevent.right='keyshow()'>
    组合键：<input type="text" @keydown.ctrl.c='keyshow()'>
  </div>
  <script>
    // 没有的键位可以自己配置
    Vue.config.keyCodes.one = 49;
    const vm = new Vue({
      el: "#app",
      methods: {
        keyshow() {
          console.log('enter');
        }
      }
    })
  </script>
</body>

</html>